package com.bw.curl.controller;

import com.alibaba.fastjson.JSON;
import com.bw.curl.entity.TestEntity.Test;
import com.bw.curl.service.TestServer;
import com.bw.curl.util.res.R;
import com.bw.curl.util.res.RUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

@RestController
public class TestController {

    @Resource
    private TestServer testServer;

    @GetMapping("/test")
    public R test(){
        List<Test> list = testServer.list();
        return RUtils.success(JSON.toJSON(list));
    }

    @RequestMapping("/")
    public String test1(){
        return  "测试jenkins-1>>>>>演示版3";
    }
}
